import request from '../utils/request'

export const findDeptAndCount= () =>{
  return request({
    url: "/department/findDeptAndCount",
    method: 'get'
  })
}

/**
 * 分页查询数据
 * @param current
 * @param size
 * @param deptVo
 * @returns {AxiosPromise}
 */
export const findDeptPage = (current,size,deptVo) => {
  return request({
    url: '/department/findDeptPage',
    method: 'post',
    params: {
      current,
      size
    },
    data : deptVo
  })
}

/**
 * 添加用部门
 */
export const addDept = (Department) => {
  return request({
    url: '/department/addDept',
    method: 'post',
    data : Department
  })
}

/**
 * 更新部门
 * @param Department
 * @returns {AxiosPromise}
 */
export const updataDepat = (Department) => {
  return request({
    url: '/department/updataDepat',
    method: 'post',
    data : Department
  })
}

/**
 * 删除部门
 * @param id
 * @returns {AxiosPromise}
 */
export function deleteDeprById(id) {
  return request({
    url: '/department/deleteDeprById',
    method: 'delete',
    params: {
      id
    }
  })
}
